USE [ERPSIADB]
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
-- =============================================
-- Author:		<Author,,Name>
-- Create date: <Create Date,,>
-- Description:	<Description,,>
-- =============================================
CREATE PROCEDURE SP_OBTENER_ENCABEZADO_DOCUMENTO 
	@idDocumentoContable bigint
AS
BEGIN
	-- SET NOCOUNT ON added to prevent extra result sets from
	-- interfering with SELECT statements.
	SET NOCOUNT ON;

    Select D.CodigoDocumento, CA.NombreDueno, D.FechaContabilizacion, D.FechaEntregaVencimiento,
		CA.NombreCuentaAuxiliar
	from DocumentoContable D
	inner join CuentaAuxiliar CA
		on D.IdCuentaAuxiliar = CA.IdCuentaAuxiliar
	where D.IdDocumentoContable = @idDocumentoContable FOR XML AUTO;
	
END
GO
